<HTML>

<BODY BGCOLOR="white">

<center>
<FONT SIZE=+2 COLOR="#BB0000">CS346 - Spring 2014<BR>Database System Implementation</FONT>
</center>

<p>
<table border=0 cellpadding=4 cellspacing=10 width="100%">
<tr><td width="100%" bgcolor="#ccccff"><font face="Arial">
<center><b>Project FAQ</b></center>
</font></td></tr>
</table>

<h4>Modifying previous components</h4>

It's very common to make changes to earlier components after you've submitted 
them. You're welcome to do so as long as you don't change the portions of the 
interfaces we specified. You may also modify the PF component if you like, as 
long as you don't modify how I/O statistics are kept. If you do make changes, 
please turn in the new files with your next submitted component, so we always 
have the latest files for your project.

<h4>String-valued attributes and string comparisons</h4>

When a RedBase attribute value is specified as a character string of
length <i>n</i>, then it contains <i>n</i> valid characters, even if
some of them are the null termination character "<code>\0</code>". For
example, suppose we have an attribute that is a character string of
length 8. Strings "<code>hello\0\0\0</code>" and
"<code>hello\01\0</code>" are both 8-character strings, and
"<code>hello\0\0\0 &lt; hello\01\0</code>" should evaluate to <code>true</code> (even though they look the same when printed).

<p>When comparing strings of different lengths, the easiest approach
is to make both strings the same length by padding the shorter one
with "<code>\0</code>" characters to match the length of the longer
one. For example, to compare "<code>hello</code>" with
"<code>helloworld</code>" you can pad "<code>hello</code>" to
"<code>hello\0\0\0\0\0</code>" then check "<code>hello\0\0\0\0\0 &lt;
helloworld</code>".
<!--
<h4>Purify bus error</h4>

<p>
A common Purify error occurs when an <tt>int</tt> or
<tt>float</tt> field in a record is not word-aligned, for example:
<pre>
   struct record {
        char[19] a;
        int b; }
</pre>
Trying to read the <tt>int</tt> directly, e.g., from the RedBase
buffer, will result in a bus error and core dump. Instead, you should
declare an <tt>int</tt> variable, <tt>memcpy</tt> into this variable
from the buffer pointer, and then access the value of the integer
through this variable.

<h4>Purify memory-in-use-at-exit warnings</h4>

<p> Some of the elaine machines seem to be not freeing memory at exit
as an optimization, making purify complain. Most likely this is not a
real memory error. It's okay to ignore the warnings, or you can remove
"<code>inuse-at-exit=yes</code>" from the <code>PURIFY_FLAGS</code>.

<br>
-->

</BODY>
</HTML>
